import http from "@/utils/request";

const apiPrefix = "/freemarkerMail";


export async function addFreemarkerMail(data) {
    return await http.request({
        data: data,
        url: apiPrefix+'/add',
        method: 'post'
    })
}

export async function deleteFreemarkerMailById(id){
    return await http.request({
        params: {
            id
        },
        url: apiPrefix+'/id',
        method: 'delete'
    })
}

export async function deleteFreemarkerMailByIds(ids){
    return await http.request({
        params: {
            ids
        },
        url: apiPrefix+'/batch',
        method: 'delete'
    })
}


export async function searchFreemarkerMailById(id){
  return await http.request({
    params: {
      id
    },
    url: apiPrefix+'/id',
    method: 'get'
  })
}
export async function searchFreemarkerMailByMailType(mailType){
  return await http.request({
    params: {
      mailType
    },
    url: apiPrefix+'/lastOne',
    method: 'get'
  })
}

export async function searchFreemarkerMail(params){
    return await http.request({
        params: params,
        url: apiPrefix,
        method: 'get'
    })
}

export async function searchFreemarkerMailByPage(params){
    return await http.request({
        params: params,
        url: apiPrefix+'/page',
        method: 'get'
    })
}


export async function updateFreemarkerMailById(data){
    return await http.request({
        data: data,
        url: apiPrefix,
        method: 'put'
    })
}
